﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_newsAss : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {
            newsAss();
        }
    }
    public void newsAss()
    {
        if (Request["ids"] != null && Request["isAss"] != null && Request["isAss"].ToString().Trim().Length>0)
        {
            string[] idArr = Request["ids"].ToString().Split(',');
            if (idArr != null && idArr.Length > 0) {
                for (int i = 0; i < idArr.Length; i++) {
                    if(idArr[i].Trim().Length>0){
                        DB.doNonQuery("update news set isAss=" + Request["isAss"].ToString() + " where newId=" + idArr[i]);
                    }
                }
            }
        }
        Response.Redirect("tree.aspx" + (Request["channelid"] != null ? "?channelid=" + Request["channelid"].ToString() : ""));
    }
}
